/**
 * 下午工作状态
 * @author liaosh
 * @date 2022-10-18 22:51
 */
public class AfternoonState implements State {

    @Override
    public void writeProgram(Work work) {
        if (work.getCurrentHour() < 17) {
            System.out.println("当前时间：" + work.getCurrentHour() + "点，下午工作状态还不错");
        } else {
            // 超过 17 点，转入傍晚工作状态
            work.setCurrentWorkState(new EveningState());
            work.writeProgram();
        }
    }
}
